package cn.avalon.controller;

import cn.avalon.dto.ProductDto;
import cn.avalon.service.ProductService;
import cn.avalon.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: Avalon
 * @date: 2022年09月19日 ： 21:22
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @PostMapping("/add")
    public AjaxResult add(@RequestBody ProductDto productDto) {

        return productService.add(productDto);
    }
}
